<template>
  <div class="cell">
    <div>
      <div>
        <span>92#</span>
        <span>汽油</span>
        <img class="img" src="../assets/1.png" alt="" />
      </div>
      <div>
        <span>{{ (date.oil_92 - v.oil_92).toFixed(2) }}</span>
        <span>{{ date.oil_92 }}</span>
        <span>(元/升)</span>
      </div>
    </div>

    <div>
      <div>
        <span>95#</span>
        <span>汽油</span>
        <img class="img" src="../assets/1.png" alt="" />
      </div>
      <div>
        <span>{{ (date.oil_95 - v.oil_95).toFixed(2) }}</span>
        <span>{{ date.oil_95 }}</span>
        <span>(元/升)</span>
      </div>
    </div>

    <div>
      <div>
        <span>98#</span>
        <span>汽油</span>
        <img class="img" src="../assets/1.png" alt="" />
      </div>
      <div>
        <span>{{ (date.oil_98 - v.oil_98).toFixed(2) }}</span>
        <span>{{ date.oil_98 }}</span>
        <span>(元/升)</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["date", "v"],

  mounted() {},
};
</script>

<style scoped>
@keyframes fade {
  from {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  to {
    opacity: 1;
  }
}

.img {
  animation: fade 2s infinite;
}
div span {
  margin: 4px;
}
.cell > div {
  border: 2px solid #db261d;
  margin: 2vh 3vw;
  padding: 2vh;
  display: flex;
  background-color: #fff;
  border-radius: 30px;
  justify-content: space-between;
  align-items: center;
}
.cell > :first-child > div:first-child > span:first-child {
  font-size: 1.5em;
}
.cell > :first-child > div:last-child > span:first-child {
  color: #db261d;
}
.cell > :first-child > div:last-child > span:nth-child(2) {
  font-size: 1.5em;
}
.cell > :first-child > div:last-child > span:nth-child(3) {
  color: gray;
}

.cell > :nth-child(2) > div:first-child > span:first-child {
  font-size: 1.5em;
}
.cell > :nth-child(2) > div:last-child > span:nth-child(1) {
  color: #db261d;
}
.cell > :nth-child(2) > div:last-child > span:nth-child(2) {
  font-size: 1.5em;
}
.cell > :nth-child(2) > div:last-child > span:nth-child(3) {
  color: gray;
}

.cell > :nth-child(3) > div:first-child > span:first-child {
  font-size: 1.5em;
}
.cell > :nth-child(3) > div:last-child > span:nth-child(1) {
  color: #db261d;
}
.cell > :nth-child(3) > div:last-child > span:nth-child(2) {
  font-size: 1.5em;
}
.cell > :nth-child(3) > div:last-child > span:nth-child(3) {
  color: gray;
}
</style>
